<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="Cask Data, Inc." name="author" />
<meta content="CDAP Docker Image" name="description" />
<meta content="Copyright © 2014-2017 Cask Data, Inc." name="copyright" />


    <meta name="git_release" content="6.1.1">
    <meta name="git_hash" content="05fbac36f9f7aadeb44f5728cea35136dbc243e5">
    <meta name="git_timestamp" content="2020-02-09 08:22:47 +0800">
    <title>Docker Image</title>

    <link rel="stylesheet" href="../../_static/cdap-bootstrap.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/bootstrap-3.3.6/css/bootstrap.min.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/bootstrap-sphinx.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/cdap-dynamicscrollspy-4.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/cdap-jquery.mCustomScrollbar.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/css/abixTreeList-2.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/cdap-bootstrap.css" type="text/css" />

    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '6.1.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>

    <link rel="shortcut icon" href="../../_static/favicon.ico"/>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="top" title="Cask Data Application Platform 6.1.1 Documentation" href="../../index.html" />
    <link rel="up" title="CDAP Sandbox" href="index.html" />
    <link rel="next" title="快速入门" href="../quick-start.html" />
    <link rel="prev" title="Virtual Machine Image" href="virtual-machine.html" />
    <!-- block extrahead -->
    <meta charset='utf-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!-- block extrahead end -->

</head>
<body role="document">

<!-- block navbar -->
<div id="navbar" class="navbar navbar-inverse navbar-default navbar-fixed-top">
    <div class="container-fluid">
      <div class="row">
        <div class="navbar-header">
          <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
          <a class="navbar-brand" href="../../table-of-contents/../../index.html">
            <span><img alt="CDAP logo" src="../../_static/cdap_logo.svg"/></span>
          </a>

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

          <div class="pull-right">
            <div class="dropdown version-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                role="button" aria-haspopup="true" aria-expanded="false">
                v 6.1.1 <span class="caret"></span>
              </a>
              <ul class="dropdown-menu">
                <li><a href="//docs.cdap.io/cdap/5.1.2/en/index.html">v 5.1.2</a></li>
                <li><a href="//docs.cdap.io/cdap/4.3.4/en/index.html">v 4.3.4</a></li>
              </ul>
            </div>
          </div>
          <form class="navbar-form navbar-right navbar-search" action="../../search.html" method="get">
            <div class="form-group">
              <div class="navbar-search-image material-icons"></div>
              <input type="text" name="q" class="form-control" placeholder="  Search" />
            </div>
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>

          <div class="collapse navbar-collapse nav-collapse navbar-right navbar-navigation">
            <ul class="nav navbar-nav"><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../index.html">简介</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link current" href="../../table-of-contents/../../guides.html">手册</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../reference-manual/index.html">参考</a></li><li class="docsite-nav-tab-container"><a class="docsite-nav-tab-link " href="../../table-of-contents/../../faqs/index.html">帮助</a></li>
            </ul>
          </div>

        </div>
      </div>
    </div>
  </div><!-- block navbar end -->
<!-- block main content -->
<div class="main-container container">
  <div class="row"><div class="col-md-2">
      <div id="sidebar" class="bs-sidenav scrollable-y-outside" role="complementary">
<!-- theme_manual: developer-manual -->
<!-- theme_manual_highlight: guides -->
<!-- sidebar_title_link: ../../table-of-contents/../../guides.html -->

  <div role="note" aria-label="manuals links"><h3><a href="../../table-of-contents/../../guides.html">Guides</a></h3>

    <ul class="this-page-menu">
      <li class="toctree-l1"><a href="../../table-of-contents/../../user-guide/index.html" rel="nofollow">用户手册</a>
      </li>
      <li class="toctree-l1"><b><a href="../../table-of-contents/../../developer-manual/index.html" rel="nofollow">开发手册</a></b>
      <nav class="pagenav">
      <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../index.html"> 简介</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../index.html"> 入门指南</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="index.html">CDAP Sandbox</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="zip.html">二进制 Zip 文件</a></li>
<li class="toctree-l3"><a class="reference internal" href="zip.html#cdap-sandbox">启动和停止 CDAP Sandbox</a></li>
<li class="toctree-l3"><a class="reference internal" href="virtual-machine.html">虚拟机镜像</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Docker 镜像</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../quick-start.html">快速入门</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dev-env.html">搭建开发环境</a></li>
<li class="toctree-l2"><a class="reference internal" href="../start-stop-cdap.html">启动和停止 CDAP</a></li>
<li class="toctree-l2"><a class="reference internal" href="../building-apps.html">构建并运行应用</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../overview/index.html"> 概述</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../overview/anatomy.html"> 大数据应用剖析</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../overview/modes.html"> 模式和组件</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../overview/abstractions.html"> 核心概念</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../overview/interfaces.html"> 编程接口</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../building-blocks/index.html"> 抽象概念</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/core.html"> Core Abstractions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/applications.html"> Applications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/datasets/index.html"> Datasets</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/overview.html"> Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/table.html"> Table API</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/fileset.html"> FileSets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/partitioned-fileset.html"> Partitioned FileSets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/time-partitioned-fileset.html"> TimePartitioned FileSets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/system-custom.html"> System and Custom Datasets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/permissions.html"> Dataset Permissions</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../building-blocks/datasets/cube.html"> Cube Dataset</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/mapreduce-programs.html"> MapReduce Programs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/plugins.html"> Plugins</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/schedules.html"> Schedules</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/secure-keys.html"> Secure Keys</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/services.html"> Services</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/spark-programs.html"> Spark Programs</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/workers.html"> Workers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/workflows.html"> Workflows</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/artifacts.html"> Artifacts</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/program-lifecycle.html"> Program Lifecycle</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/namespaces.html"> Namespaces</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/transaction-system.html"> Transaction System</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../building-blocks/transactional-messaging-system.html"> Transactional Messaging System</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../metadata/index.html"> 元数据</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/system-metadata.html"> System Metadata</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/discovery-lineage.html"> Discovery and Lineage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/field-lineage.html"> Field Level Lineage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/audit-logging.html"> Audit Logging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/metadata-ui.html"> CDAP Metadata UI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metadata/programmatic-metadata.html"> Accessing metadata programmatically</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../pipelines/index.html"> 数据流管道</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/concepts-design.html"> Concepts and Design</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/getting-started.html"> Getting Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/studio.html"> CDAP Studio</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/creating-pipelines.html"> Creating Pipelines</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/running-pipelines.html"> Running Pipelines</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/plugin-management.html"> Plugin Management</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/plugins/index.html"> Plugin Reference</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/actions/index.html"> Action Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/sources/index.html"> Source Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/transforms/index.html"> Transform Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/analytics/index.html"> Analytic Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/sinks/index.html"> Sink Plugins</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/shared-plugins/index.html"> Shared Plugins</a><ul>
<li class="toctree-l4"><a class="reference internal" href="../../pipelines/plugins/shared-plugins/core.html">CoreValidator</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/plugins/post-run-plugins/index.html"> Post-run Plugins</a><ul class="simple">
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/developing-pipelines.html"> Developing Pipelines</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/developing-plugins/index.html"> Developing Plugins</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/developing-plugins/plugin-basics.html">Plugin Basics</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/developing-plugins/creating-a-plugin.html">Creating a Plugin</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/developing-plugins/presentation-plugins.html">Plugin Presentation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/developing-plugins/testing-plugins.html">Testing Plugins</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../pipelines/developing-plugins/packaging-plugins.html">Packaging Plugins</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../pipelines/how-cdap-pipelines-work.html"> How CDAP Pipelines Work</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../cloud-runtimes/index.html"> 云平台运行</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../cloud-runtimes/concepts/index.html"> Concepts</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cloud-runtimes/provisioners/index.html"> Provisioners</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/provisioners/gcp-dataproc.html">Google Dataproc</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/provisioners/aws-emr.html">Amazon Elastic MapReduce</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/provisioners/remote-hadoop.html">Remote Hadoop</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../cloud-runtimes/profiles/index.html"> Profiles</a><ul>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/profiles/creating-profiles.html">Creating Profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/profiles/assigning-profiles.html">Assigning Profiles</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../cloud-runtimes/profiles/admin-controls.html">Admin Controls</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../cloud-runtimes/example/index.html"> Example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../security/index.html"> 安全</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../security/client-authentication.html">Client Authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../security/cdap-authentication-clients-java.html">CDAP Authentication Client for Java</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../security/cdap-authentication-clients-python.html">CDAP Authentication Client for Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../security/custom-authentication.html">Custom Authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../security/authorization-extensions.html">Authorization Extensions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../testing/index.html"> 测试和调试</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../testing/testing.html"> Testing a CDAP Application</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../testing/debugging.html"> Debugging</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../testing/troubleshooting.html"> Troubleshooting</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../ingesting-tools/index.html"> 数据融合</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../ingesting-tools/cdap-stream-clients-java.html">CDAP Stream Client for Java</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../ingesting-tools/cdap-stream-clients-python.html">CDAP Stream Client for Python</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../ingesting-tools/cdap-stream-clients-ruby.html">CDAP Stream Client for Ruby</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../ingesting-tools/cdap-flume.html">CDAP Flume</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../data-exploration/index.html"> 数据探索</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../data-exploration/filesets.html"> Fileset Exploration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../data-exploration/tables.html"> Table Exploration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../data-exploration/object-mapped-tables.html"> ObjectMappedTable Exploration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../data-exploration/custom-datasets.html"> Custom Dataset Exploration</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../data-exploration/hive-execution-engines.html"> Hive Execution Engines</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../advanced/index.html"> 高级主题</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../../advanced/application-logback.html"> Application Logback</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../advanced/best-practices.html"> Best Practices</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../advanced/class-loading.html"> Class Loading</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../advanced/configuring-resources.html"> Configuring Program Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../advanced/program-retry-policies.html"> Program Retry Policies</a></li>
</ul>
</li>
</ul>
</nav>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../admin-manual/index.html" rel="nofollow">管理手册</a>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../integrations/index.html" rel="nofollow">集成手册</a>
      </li>
      <li class="toctree-l1"><a href="../../table-of-contents/../../examples-manual/index.html" rel="nofollow">最佳实践</a>
      </li>
    </ul>
  </div></div>
    </div><div class="col-md-8 content" id="main-content">
    
  <div class="section" id="docker-image">
<h1>Docker Image<a class="headerlink" href="#docker-image" title="Permalink to this headline">🔗</a></h1>
<p>Docker is one of the easiest ways to start working with CDAP without having to manually
configure anything. A Docker image with the CDAP Sandbox pre-installed is available
on the Docker Hub for download.</p>
<p>To use the <strong>Docker image</strong>, you can either start the container from <a class="reference internal" href="#docker-command-line"><span class="std std-ref">a command line</span></a> or use Docker’s <a class="reference internal" href="#docker-kitematic"><span class="std std-ref">Kitematic</span></a> (on Mac OS X
and Windows), a graphical user interface for running Docker containers.</p>
<div class="section" id="docker-from-a-command-line">
<span id="docker-command-line"></span><h2>Docker from a Command Line<a class="headerlink" href="#docker-from-a-command-line" title="Permalink to this headline">🔗</a></h2>
<p>Docker environments are available for a variety of platforms. Download and install Docker for your platform by
following the <a class="reference external" href="https://docs.docker.com/engine/installation/">platform-specific installation instructions</a>
from <a class="reference external" href="https://docker.com">Docker.com</a>, and verify that the Docker environment is working and has
started correctly.</p>
<ol class="arabic">
<li><p class="first">If you are not running on Linux, you will need to create and start a Docker Virtual Machine (VM) before you
can use containers. For example:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral41() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral41 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral41", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral41" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker-machine create --driver virtualbox cdap
<span class="go">  . . .</span>

<span class="gp">$ </span><span class="copyable-text">docker-machine env cdap</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker-machine create --driver virtualbox cdap
<span class="go">  . . .</span>

<span class="gp">&gt; </span><span class="copyable-text">docker-machine env cdap</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
<p>This will create a new Docker virtual machine using VirtualBox named <code class="docutils literal notranslate"><span class="pre">cdap</span></code>; once
created and running, the second command will print out the environment.</p>
</li>
<li><p class="first">When you run <code class="docutils literal notranslate"><span class="pre">docker-machine</span> <span class="pre">env</span> <span class="pre">cdap</span></code>, it will print a message on the screen such as:</p>
<div class="copyable copyable-text container">
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">export DOCKER_TLS_VERIFY=&quot;1&quot;</span>
<span class="go">export DOCKER_HOST=&quot;tcp://192.168.99.100:2376&quot;</span>
<span class="go">export DOCKER_CERT_PATH=&quot;/Users/&lt;username&gt;/.docker/machine/machines/cdap&quot;</span>
<span class="go">export DOCKER_MACHINE_NAME=&quot;cdap&quot;</span>
<span class="gp">#</span> Run this <span class="nb">command</span> to configure your shell:
<span class="gp">#</span> <span class="nb">eval</span> <span class="k">$(</span>docker-machine env cdap<span class="k">)</span>
</pre></div>
</div>
</div>
<p>It is essential to run these export commands (or the single <code class="docutils literal notranslate"><span class="pre">eval</span></code> command, <code class="docutils literal notranslate"><span class="pre">eval</span>
<span class="pre">$(docker-machine</span> <span class="pre">env</span> <span class="pre">cdap)</span></code>). Otherwise, subsequent Docker commands will fail because
they won’t be able to connect to the correct Docker VM.</p>
</li>
<li><p class="first">If you are running <strong>Docker on either Mac OS X or Microsoft Windows</strong>, Docker is running a
virtual Linux machine on top of your host OS. You will need to use the address shown
above (such as <code class="docutils literal notranslate"><span class="pre">192.168.99.100</span></code>) as the host name when either connecting to the CDAP
UI or making an HTTP request.</p>
</li>
<li><p class="first">If you are running <strong>Docker on Microsoft Windows</strong>, note that paths used employ Linux’s
forward-slashes (<code class="docutils literal notranslate"><span class="pre">/</span></code>) and not back-slashes (<code class="docutils literal notranslate"><span class="pre">\</span></code>).</p>
</li>
<li><p class="first">Once Docker has started, pull down the <em>CDAP Docker Image</em> from the Docker Hub using:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral42() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral42 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral42", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral42" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker pull caskdata/cdap-sandbox:6.1.1
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker pull caskdata/cdap-sandbox:6.1.1
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">Start the <em>CDAP Sandbox</em> Docker container with:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral43() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral43 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral43", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral43" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -d --name cdap-sandbox -p <span class="m">11011</span>:11011 -p <span class="m">11015</span>:11015 caskdata/cdap-sandbox:6.1.1
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -d --name cdap-sandbox -p <span class="m">11011</span>:11011 -p <span class="m">11015</span>:11015 caskdata/cdap-sandbox:6.1.1
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
<p>This will start the container (in the background), name it <code class="docutils literal notranslate"><span class="pre">cdap-sandbox</span></code>, and set the proxying of ports.</p>
</li>
<li><p class="first">Start the <em>CDAP Sandbox</em> Docker container with:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral44() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral44 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral44", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral44" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -it --name cdap-sandbox-debugging -p <span class="m">11011</span>:11011 -p <span class="m">11015</span>:11015 caskdata/cdap-sandbox:6.1.1 cdap sandbox start --enable-debug --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -it --name cdap-sandbox-debugging -p <span class="m">11011</span>:11011 -p <span class="m">11015</span>:11015 caskdata/cdap-sandbox:6.1.1 cdap sandbox start --enable-debug --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
<p>This will start the container (in the foreground, the default), <a class="reference internal" href="../../testing/debugging.html#debugging-sandbox"><span class="std std-ref">enable debugging</span></a>, name it <code class="docutils literal notranslate"><span class="pre">cdap-sandbox-debugging</span></code>, and set the proxying of ports.</p>
</li>
<li><p class="first">CDAP will start automatically once the container starts. CDAP’s software
directory is under <code class="docutils literal notranslate"><span class="pre">/opt/cdap/sandbox</span></code>.</p>
</li>
<li><p class="first">Once CDAP starts, it will instruct you to connect to the CDAP UI with a web browser
at <a class="reference external" href="http://localhost:11011/oldcdap/ns/default/">http://localhost:11011/</a>.</p>
</li>
<li><p class="first">If you are <strong>running Docker on either Mac OS X or Microsoft Windows</strong>, replace <code class="docutils literal notranslate"><span class="pre">localhost</span></code>
with the Docker VM’s IP address (such as <code class="docutils literal notranslate"><span class="pre">192.168.99.100</span></code>) that you obtained earlier.
Start a browser and enter the address to access the CDAP UI from outside Docker.</p>
</li>
</ol>
<div class="section" id="options-starting-cdap-containers">
<h3>Options Starting CDAP Containers<a class="headerlink" href="#options-starting-cdap-containers" title="Permalink to this headline">🔗</a></h3>
<ul>
<li><p class="first">Starting the CDAP Sandbox, in the background (default execution)</p>

<script type="text/javascript">

  $(function tabbedparsedliteral45() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral45 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral45", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral45" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -d --name cdap-sandbox caskdata/cdap-sandbox
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -d --name cdap-sandbox caskdata/cdap-sandbox
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">Use the CDAP CLI within the above <em>cdap-sandbox</em> container:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral46() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral46 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral46", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral46" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker <span class="nb">exec</span> -it cdap-sandbox cdap cli
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker <span class="nb">exec</span> -it cdap-sandbox cdap cli
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">Use the CDAP CLI in its own container (<em>cdap-cli</em>), against a remote CDAP instance at <code class="docutils literal notranslate"><span class="pre">${CDAP_HOST}</span></code>:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral47() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral47 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral47", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral47" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -it --name cdap-cli --rm caskdata/cdap-sandbox cdap cli -u http://<span class="si">${</span><span class="nv">CDAP_HOST</span><span class="si">}</span>:11015
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -it --name cdap-cli --rm caskdata/cdap-sandbox cdap cli -u http://<span class="si">${</span><span class="nv">CDAP_HOST</span><span class="si">}</span>:11015
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">Starting the CDAP Sandbox, in the foreground, with ports forwarded:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral48() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral48 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral48", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral48" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -it -p <span class="m">11015</span>:11015 -p <span class="m">11011</span>:11011 --name cdap-sandbox caskdata/cdap-sandbox cdap sandbox start --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -it -p <span class="m">11015</span>:11015 -p <span class="m">11011</span>:11011 --name cdap-sandbox caskdata/cdap-sandbox cdap sandbox start --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">Starting the CDAP Sandbox, in the foreground, with ports forwarded, and with debugging enabled:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral49() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral49 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral49", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral49" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker run -it -p <span class="m">11015</span>:11015 -p <span class="m">11011</span>:11011 --name cdap-sandbox caskdata/cdap-sandbox cdap sandbox start --enable-debug --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker run -it -p <span class="m">11015</span>:11015 -p <span class="m">11011</span>:11011 --name cdap-sandbox caskdata/cdap-sandbox cdap sandbox start --enable-debug --foreground
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">For information on mounting volumes and sharing data with the container, see the
examples in Docker’s documentation on <a class="reference external" href="https://docs.docker.com/engine/tutorials/dockervolumes/#/adding-a-data-volume">data volumes</a>.
You can either let Docker manage the storage in the container (the easiest) or you can
<a class="reference external" href="https://docs.docker.com/engine/tutorials/dockervolumes/#/mount-a-host-directory-as-a-data-volume">mount a host directory as a data volume</a>.
However, if you mount a host directory, you must make sure that it exists and that
permissions are set correctly. You pass such a directory using <code class="docutils literal notranslate"><span class="pre">-v</span>
<span class="pre">/my/own/datadir:/opt/cdap/sandbox/my/own/datadir</span></code>, which mounts the <code class="docutils literal notranslate"><span class="pre">/my/own/datadir</span></code> from the
host system as <code class="docutils literal notranslate"><span class="pre">/opt/cdap/sandbox/my/own/datadir</span></code> in the container.</p>
</li>
</ul>
</div>
<div class="section" id="controlling-the-cdap-instance">
<h3>Controlling the CDAP Instance<a class="headerlink" href="#controlling-the-cdap-instance" title="Permalink to this headline">🔗</a></h3>
<ul>
<li><p class="first">To control the CDAP instance, use this command, substituting one of <code class="docutils literal notranslate"><span class="pre">start</span></code>, <code class="docutils literal notranslate"><span class="pre">restart</span></code>, <code class="docutils literal notranslate"><span class="pre">stop</span></code>,
or <code class="docutils literal notranslate"><span class="pre">status</span></code> for <code class="docutils literal notranslate"><span class="pre">&lt;command&gt;</span></code>:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral50() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral50 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral50", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral50" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox &lt;command&gt;

<span class="gp">$ </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox start</span>
<span class="gp">$ </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox restart</span>
<span class="gp">$ </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox stop</span>

<span class="gp"># </span><span class="copyable-text">To see the status:</span>
<span class="gp">$ </span><span class="copyable-text">docker <span class="nb">exec</span> -it cdap-sandbox cdap sandbox status</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox &lt;command&gt;

<span class="gp">&gt; </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox start</span>
<span class="gp">&gt; </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox restart</span>
<span class="gp">&gt; </span><span class="copyable-text">docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox stop</span>

<span class="gp"># </span><span class="copyable-text">To see the status:</span>
<span class="gp">&gt; </span><span class="copyable-text">docker <span class="nb">exec</span> -it cdap-sandbox cdap sandbox status</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
<li><p class="first">When you are finished, stop CDAP and then shutdown the Docker machine:</p>

<script type="text/javascript">

  $(function tabbedparsedliteral51() {
    var tabs = ['linux', 'windows'];
    var mapping = {'windows': 'windows', 'linux': 'linux'};
    var tabSetID = 'linux-windows';
    for (var i = 0; i < tabs.length; i++) {
      var tab = tabs[i];
      $("#tabbedparsedliteral51 .example-tab-" + tab).click(changeExampleTab(tab, mapping, "tabbedparsedliteral51", tabSetID));
    }
  });

</script>
<div id="tabbedparsedliteral51" class="tabbed-parsed-literal dependent-linux-windows">
<ul class="tabbed-parsed-literal nav-tabs">
<li class="example-tab example-tab-linux active"><a href="#">Linux or Mac OS X</a></li>
<li class="example-tab example-tab-windows "><a href="#">Windows</a></li>
</ul>

<div class="tab-contents">

<div class="tab-pane tab-pane-linux active">
<div class="code code-tab">
<div class="highlight-console">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">$</span> docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox stop
<span class="gp">$ </span><span class="copyable-text">docker-machine stop cdap</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
<div class="tab-pane tab-pane-windows ">
<div class="code code-tab">
<div class="highlight-shell-session">
<!-- tabbed-parsed-literal start -->
<div class="highlight"><pre><span></span><span class="gp">&gt;</span> docker <span class="nb">exec</span> -d cdap-sandbox cdap sandbox stop
<span class="gp">&gt; </span><span class="copyable-text">docker-machine stop cdap</span>
</pre></div>
<!-- tabbed-parsed-literal end --></div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="section" id="docker-resources">
<h3>Docker Resources<a class="headerlink" href="#docker-resources" title="Permalink to this headline">🔗</a></h3>
<ul class="simple">
<li>For a full list of Docker Commands, see the <a class="reference external" href="https://docs.docker.com/engine/reference/commandline/cli/">Docker Command Line Documentation.</a></li>
</ul>
</div>
</div>
<div class="section" id="docker-using-kitematic">
<span id="docker-kitematic"></span><h2>Docker using Kitematic<a class="headerlink" href="#docker-using-kitematic" title="Permalink to this headline">🔗</a></h2>
<p><a class="reference external" href="https://www.docker.com/docker-kitematic">Docker Kitematic</a> is available as part of the
<a class="reference external" href="https://www.docker.com/products/overview">Docker</a> for either Mac OS X or Microsoft Windows.
It is a graphical user interface for running Docker containers. Follow these steps to install
Kitematic and then download, start, and connect to a CDAP container.</p>
<ol class="arabic">
<li><p class="first">Download and install <a class="reference external" href="https://www.docker.com/products/overview">Docker</a> for
either Mac OS X or Microsoft Windows.</p>
</li>
<li><p class="first">Download and install Kitematic for either Mac OS X or Microsoft Windows. The easiest
method is to select <em>Open Kitematic</em> from the <em>Docker</em> menu, and follow the
instructions for downloading and installing it:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-0-installing.png"><img alt="../../_images/kitematic-0-installing.png" class="bordered-image" src="../../_images/kitematic-0-installing.png" style="width: 300px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">Start Kitematic. On Mac OS X, it will be installed in <code class="docutils literal notranslate"><span class="pre">/Applications/Docker/Kitematic</span></code>; on
Windows, in <code class="docutils literal notranslate"><span class="pre">Start</span> <span class="pre">Menu</span> <span class="pre">&gt;</span> <span class="pre">Docker</span> <span class="pre">&gt;</span> <span class="pre">Kitematic</span></code>.</p>
</li>
<li><p class="first">Once Kitematic has started, search for the <strong>CDAP image</strong> by using the search box at the
top of the window and entering <code class="docutils literal notranslate"><span class="pre">caskdata:cdap-sandbox</span></code>. Once you have found the page,
click on the <strong>repository menu</strong>, circled in red here:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-1-searching.png"><img alt="../../_images/kitematic-1-searching.png" class="bordered-image" src="../../_images/kitematic-1-searching.png" style="width: 800px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">Click on the <strong>tags</strong> button:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-2-tags.png"><img alt="../../_images/kitematic-2-tags.png" class="bordered-image" src="../../_images/kitematic-2-tags.png" style="width: 400px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">Select the <strong>desired version</strong>. Note that the tag <em>latest</em> is the last version that
was put up at Docker Hub, which is not the necessarily the desired version, which is
<strong>6.1.1</strong> (<em>3.5.0</em> shown as an illustration):</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-3-select-tag.png"><img alt="../../_images/kitematic-3-select-tag.png" class="bordered-image" src="../../_images/kitematic-3-select-tag.png" style="width: 400px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">Close the menu by pressing the <code class="docutils literal notranslate"><span class="pre">X</span></code> in the circle. Click “Create” to download and start the CDAP image.
When it has started up, you will see in the logs a message that the CDAP UI is listening on port 11011:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-4-cdap-started.png"><img alt="../../_images/kitematic-4-cdap-started.png" class="bordered-image" src="../../_images/kitematic-4-cdap-started.png" style="width: 800px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">To connect a web browser for the CDAP UI, you’ll need to find the external IP addresses
and ports that the Docker host is exposing. These are listed on the right-hand side of
the previous illustration:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-5-links.png"><img alt="../../_images/kitematic-5-links.png" class="bordered-image" src="../../_images/kitematic-5-links.png" style="width: 400px;" /></a>
</div>
</div></blockquote>
</li>
<li><p class="first">This shows that the CDAP container is listening on the internal port <code class="docutils literal notranslate"><span class="pre">11011</span></code> within the
Docker host, while the Docker host proxies that port on the virtual machine IP address
and port (<code class="docutils literal notranslate"><span class="pre">localhost:32773</span></code>). Enter that address and port into your system web browser to
connect to the CDAP UI, such as <a class="reference external" href="http://localhost:32773">http://localhost:32773</a>:</p>
<blockquote>
<div><div class="figure" style="width: 100%">
<a class="bordered-image reference internal image-reference" href="../../_images/kitematic-6-cdap-ui.png"><img alt="../../_images/kitematic-6-cdap-ui.png" class="bordered-image" src="../../_images/kitematic-6-cdap-ui.png" style="width: 800px;" /></a>
</div>
</div></blockquote>
</li>
</ol>
</div>
<div class="section" id="docker-and-cdap-applications">
<span id="docker-cdap-applications"></span><h2>Docker and CDAP Applications<a class="headerlink" href="#docker-and-cdap-applications" title="Permalink to this headline">🔗</a></h2>
<ul class="simple">
<li>In order to begin building CDAP applications, have our <a class="reference internal" href="index.html#system-requirements"><span class="std std-ref">recommended software and tools</span></a> installed in your environment.</li>
</ul>
</div>
<div class="section" id="id1">
<h2>搭建开发环境<a class="headerlink" href="#id1" title="Permalink to this headline">🔗</a></h2>
<div class="section" id="id2">
<h3>创建应用<a class="headerlink" href="#id2" title="Permalink to this headline">🔗</a></h3>
<p>当开发一个 CDAP 应用时, 最好使用一个理解应用结构的集成开发环境 (IDE),
由集成开发环境提供编写接口方法时进行代码自动完成.</p>
</div>
<div class="section" id="intellij">
<h3>使用 IntelliJ<a class="headerlink" href="#intellij" title="Permalink to this headline">🔗</a></h3>
<ol class="arabic simple">
<li>打开 <a class="reference external" href="https://www.jetbrains.com/idea/">IntelliJ</a> 并这样导入 Maven 工程:<ul>
<li>如果要启动 IntelliJ 对话框, 请单击 <em>导入工程</em>; 或者</li>
<li>如果要打开一个已经存在一个工程, 请使用菜单项 <em>文件 -&gt; 打开…</em></li>
</ul>
</li>
<li>浏览并选择 Maven 工程目录下的 <code class="docutils literal notranslate"><span class="pre">pom.xml</span></code> 文件.</li>
<li>在 <em>从 Maven 导入工程</em> 对话框中, 选择 <em>自动导入 Maven 工程</em> 并且选中 <em>自动下载: 源码, 文档</em> 框.</li>
<li>单击 <em>下一步</em>, 完成剩余的对话框, 然后新的 CDAP 工程就会创建并打开.</li>
</ol>
</div>
<div class="section" id="eclipse">
<h3>使用 Eclipse<a class="headerlink" href="#eclipse" title="Permalink to this headline">🔗</a></h3>
<ol class="arabic simple">
<li>在你的 <a class="reference external" href="https://www.eclipse.org/">Eclipse</a> 安装中, 确保
<a class="reference external" href="http://m2eclipse.sonatype.org">m2eclipse</a> 插件已安装.</li>
<li>点击菜单 <em>文件 -&gt; 导入</em></li>
<li>在 <em>选择一个导入源</em> 对话框中输入 <em>maven</em> 来查找 Maven 选项.</li>
<li>选择 <em>存在的 Maven 工程</em> 作为导入源.</li>
<li>浏览到你的 Maven 工程目录.</li>
<li>单击 <em>完成</em>, 然后新的 CDAP 工程就会被导入, 创建并打开.</li>
</ol>
</div>
<div class="section" id="ide-cdap">
<h3>在 IDE 中运行 CDAP<a class="headerlink" href="#ide-cdap" title="Permalink to this headline">🔗</a></h3>
<p>由于 CDAP 是一个开源项目, 你可以下载源码, 并导入进 IDE,
然后修改, 构建, 并运行 CDAP.</p>
<p>要完成这个工作, 请按下面步骤操作:</p>
<ol class="arabic simple">
<li>安装全部 CDAP 开发 <a class="reference internal" href="index.html#system-requirements"><span class="std std-ref">系统需要的前提条件</span></a>.</li>
<li>克隆 CDAP 仓库或者下载源码 ZIP 包:<ul>
<li>克隆 CDAP 仓库, 需要使用 <code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">git</span> <span class="pre">clone</span> <span class="pre">-b</span> <span class="pre">v6.1.1</span> <span class="pre">https://github.com/cdapio/cdap.git</span></code></li>
<li>下载 ZIP 源码包(可以从这里 <a class="reference external" href="https://github.com/cdapio/cdap/archive/v6.1.1.zip">GitHub</a>), 然后把 ZIP 包解压到一个合适位置</li>
</ul>
</li>
<li>在你的 IDE 中, 安装 Scala 插件 (对于
<a class="reference external" href="https://confluence.jetbrains.com/display/SCA/Scala+Plugin+for+IntelliJ+IDEA">IntelliJ</a>
或者 <a class="reference external" href="http://scala-ide.org">Eclipse</a>), 因为工程中包含 Scala 代码.</li>
<li>通过查找并打开 <code class="docutils literal notranslate"><span class="pre">cdap/pom.xml</span></code> 文件, 在 IDE 中把 CDAP 工程作为一个存在的工程打开.</li>
<li>解决依赖关系: 这需要一会儿时间, 因为需要下载大量内容.</li>
<li>对于 IntelliJ, 你可以创建一个运行配置来运行 CDAP Sandbox:<ol class="arabic">
<li>选择 <code class="docutils literal notranslate"><span class="pre">运行</span> <span class="pre">&gt;</span> <span class="pre">编辑</span></code> 配置…</li>
<li>添加一个新 “应用” 来运行配置.</li>
<li>设置 “Main class” 为 <code class="docutils literal notranslate"><span class="pre">io.cdap.cdap.StandaloneMain</span></code>.</li>
<li>设置 “VM options” 为 <code class="docutils literal notranslate"><span class="pre">-Xmx1024m</span></code> (对于 in-memory MapReduce jobs).</li>
<li>单击 “OK”.</li>
<li>你现在可以使用这个运行配置来启动一个 CDAP Sandbox 实例.</li>
</ol>
</li>
</ol>
<p>这将允许你启动 CDAP 并使用命令行 (<span class="xref std std-ref">CLI</span>)
或者通过 <span class="xref std std-ref">HTTP RESTful API</span> 访问.
要启动 CLI, 你可以在 shell 中使用 <code class="docutils literal notranslate"><span class="pre">cdap</span></code> 脚本或者从 IDE 中运行 <code class="docutils literal notranslate"><span class="pre">CLIMain</span></code> 类.</p>
<p>如果你想要运行和开发 UI 界面, 你需要根据 <a class="reference external" href="https://github.com/cdapio/cdap/blob/v6.1.1/cdap-ui/README.rst">CDAP UI README</a> 中的步骤操作.</p>
</div>
</div>
<div class="section" id="cdap">
<h2>构建和运行 CDAP 应用<a class="headerlink" href="#cdap" title="Permalink to this headline">🔗</a></h2>
<p>See <a class="reference internal" href="../building-apps.html#cdap-building-running"><span class="std std-ref">Building and Running CDAP Applications</span></a> for information
on accessing the CDAP CLI and CDAP Local Sandbox <code class="docutils literal notranslate"><span class="pre">bin</span></code> utilities, building examples,
starting CDAP, and deploying, starting, and stopping applications.</p>
</div>
</div>

</div>
    <div class="col-md-2">
      <div id="right-sidebar" class="bs-sidenav scrollable-y" role="complementary">
        <div id="localtoc-scrollspy">
        </div>
      </div>
    </div></div>
</div>
<!-- block main content end -->
<!-- block footer -->
<footer class="footer">
      <div class="container">
        <div class="row">
          <div class="col-md-2 footer-left"><a title="Virtual Machine Image" href="virtual-machine.html" />Previous</a></div>
          <div class="col-md-8 footer-center"><a class="footer-tab-link" href="../../table-of-contents/../../reference-manual/licenses/index.html">Copyright</a> &copy; 2014-2020 Cask Data, Inc.&bull; <a class="footer-tab-link" href="//docs.cask.co/cdap/6.1.1/cdap-docs-6.1.1-web.zip" rel="nofollow">Download</a> an archive or
<a class="footer-tab-link" href="//docs.cask.co/cdap">switch the version</a> of the documentation
          </div>
          <div class="col-md-2 footer-right"><a title="快速入门" href="../quick-start.html" />Next</a></div>
        </div>
      </div>
    </footer>
<!-- block footer end -->
<script type="text/javascript" src="../../_static/bootstrap-3.3.6/js/bootstrap.min.js"></script><script type="text/javascript" src="../../_static/js/bootstrap-sphinx.js"></script><script type="text/javascript" src="../../_static/js/abixTreeList-2.js"></script><script type="text/javascript" src="../../_static/js/cdap-dynamicscrollspy-4.js"></script><script type="text/javascript" src="../../_static/js/cdap-version-menu.js"></script><script type="text/javascript" src="../../_static/js/copy-to-clipboard.js"></script><script type="text/javascript" src="../../_static/js/jquery.mousewheel.min.js"></script><script type="text/javascript" src="../../_static/js/jquery.mCustomScrollbar.js"></script><script type="text/javascript" src="../../_static/js/js.cookie.js"></script><script type="text/javascript" src="../../_static/js/tabbed-parsed-literal-0.2.js"></script><script type="text/javascript" src="../../_static/js/cdap-onload-javascript.js"></script><script type="text/javascript" src="../../_static/js/cdap-version-menu.js"></script>
    <script src="https://cdap.gitee.io/docs/cdap/json-versions.js"/></script>
  </body>
</html>